import axios from '~/axios'
import { joinPramas } from './manager'

// 权限列表
export function api_permission_list(getParams) {
    let url = '/api/sys/permission/list'
    let finalUrl = joinPramas(url, getParams)
    return axios.get(finalUrl)
}

// 新增
export function api_permission_add(jsonData) {
    let url = '/api/sys/permission/add'
    return axios.post(url, jsonData)
}

// 更新
export function api_permission_update(id, jsonData) {
    let url = '/api/sys/permission/edit'
    jsonData.id = id
    return axios.post(url, jsonData)
}

// 删除
export function api_permission_delete(id) {
    let url = '/api/sys/permission/delete/' + id
    return axios.post(url, {})
}

// 获取权限树
export function api_permission_tree() {
    let url = '/api/sys/permission/tree'
    return axios.get(url)
}